<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>gmime-encodings: GMime 3.0 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GMime 3.0 Reference Manual">
<link rel="up" href="core.html" title="Part III. GMime Core Reference">
<link rel="prev" href="gmime-gmime-iconv-utils.html" title="gmime-iconv-utils">
<link rel="next" href="gmime-gmime-utils.html" title="gmime-utils">
<meta name="generator" content="GTK-Doc V1.32 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#gmime-gmime-encodings.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="core.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gmime-gmime-iconv-utils.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gmime-gmime-utils.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gmime-gmime-encodings"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gmime-gmime-encodings.top_of_page"></a>gmime-encodings</span></h2>
<p>gmime-encodings — MIME encoding functions</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gmime-gmime-encodings.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="returnvalue">GMimeContentEncoding</span></a>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-content-encoding-from-string" title="g_mime_content_encoding_from_string ()">g_mime_content_encoding_from_string</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-content-encoding-to-string" title="g_mime_content_encoding_to_string ()">g_mime_content_encoding_to_string</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-init-encode" title="g_mime_encoding_init_encode ()">g_mime_encoding_init_encode</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-init-decode" title="g_mime_encoding_init_decode ()">g_mime_encoding_init_decode</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-reset" title="g_mime_encoding_reset ()">g_mime_encoding_reset</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-outlen" title="g_mime_encoding_outlen ()">g_mime_encoding_outlen</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-step" title="g_mime_encoding_step ()">g_mime_encoding_step</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-flush" title="g_mime_encoding_flush ()">g_mime_encoding_flush</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#GMIME-BASE64-ENCODE-LEN:CAPS" title="GMIME_BASE64_ENCODE_LEN()">GMIME_BASE64_ENCODE_LEN</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-base64-decode-step" title="g_mime_encoding_base64_decode_step ()">g_mime_encoding_base64_decode_step</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-base64-encode-step" title="g_mime_encoding_base64_encode_step ()">g_mime_encoding_base64_encode_step</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-base64-encode-close" title="g_mime_encoding_base64_encode_close ()">g_mime_encoding_base64_encode_close</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#GMIME-UUENCODE-LEN:CAPS" title="GMIME_UUENCODE_LEN()">GMIME_UUENCODE_LEN</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-uudecode-step" title="g_mime_encoding_uudecode_step ()">g_mime_encoding_uudecode_step</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-uuencode-step" title="g_mime_encoding_uuencode_step ()">g_mime_encoding_uuencode_step</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-uuencode-close" title="g_mime_encoding_uuencode_close ()">g_mime_encoding_uuencode_close</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#GMIME-QP-ENCODE-LEN:CAPS" title="GMIME_QP_ENCODE_LEN()">GMIME_QP_ENCODE_LEN</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-quoted-decode-step" title="g_mime_encoding_quoted_decode_step ()">g_mime_encoding_quoted_decode_step</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-quoted-encode-step" title="g_mime_encoding_quoted_encode_step ()">g_mime_encoding_quoted_encode_step</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-quoted-encode-close" title="g_mime_encoding_quoted_encode_close ()">g_mime_encoding_quoted_encode_close</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gmime-gmime-encodings.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding">GMimeContentEncoding</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="gmime-gmime-encodings.html#GMimeEncodingConstraint" title="enum GMimeEncodingConstraint">GMimeEncodingConstraint</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding">GMimeEncoding</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="gmime-gmime-encodings.html#GMIME-UUDECODE-STATE-INIT:CAPS" title="GMIME_UUDECODE_STATE_INIT">GMIME_UUDECODE_STATE_INIT</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="gmime-gmime-encodings.html#GMIME-UUDECODE-STATE-BEGIN:CAPS" title="GMIME_UUDECODE_STATE_BEGIN">GMIME_UUDECODE_STATE_BEGIN</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="gmime-gmime-encodings.html#GMIME-UUDECODE-STATE-END:CAPS" title="GMIME_UUDECODE_STATE_END">GMIME_UUDECODE_STATE_END</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gmime-gmime-encodings.description"></a><h2>Description</h2>
<p>Utility functions to encode or decode MIME
Content-Transfer-Encodings.</p>
</div>
<div class="refsect1">
<a name="gmime-gmime-encodings.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="g-mime-content-encoding-from-string"></a><h3>g_mime_content_encoding_from_string ()</h3>
<pre class="programlisting"><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="returnvalue">GMimeContentEncoding</span></a>
g_mime_content_encoding_from_string (<em class="parameter"><code>const <span class="type">char</span> *str</code></em>);</pre>
<p>Gets the appropriate <a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> enumeration value based
on the input string.</p>
<div class="refsect3">
<a name="g-mime-content-encoding-from-string.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>a string representing a Content-Transfer-Encoding value</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-content-encoding-from-string.returns"></a><h4>Returns</h4>
<p> the <a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> specified by <em class="parameter"><code>str</code></em>
or
<a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-DEFAULT:CAPS"><span class="type">GMIME_CONTENT_ENCODING_DEFAULT</span></a> on error.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-content-encoding-to-string"></a><h3>g_mime_content_encoding_to_string ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
g_mime_content_encoding_to_string (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> encoding</code></em>);</pre>
<p>Gets the string value of the content encoding.</p>
<div class="refsect3">
<a name="g-mime-content-encoding-to-string.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>encoding</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-content-encoding-to-string.returns"></a><h4>Returns</h4>
<p> the encoding type as a string or <code class="literal">NULL</code> on error. Available
values for the encoding are: <a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-DEFAULT:CAPS"><span class="type">GMIME_CONTENT_ENCODING_DEFAULT</span></a>,
<a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-7BIT:CAPS"><span class="type">GMIME_CONTENT_ENCODING_7BIT</span></a>, <a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-8BIT:CAPS"><span class="type">GMIME_CONTENT_ENCODING_8BIT</span></a>,
<a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-BINARY:CAPS"><span class="type">GMIME_CONTENT_ENCODING_BINARY</span></a>, <a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-BASE64:CAPS"><span class="type">GMIME_CONTENT_ENCODING_BASE64</span></a>,
<a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-QUOTEDPRINTABLE:CAPS"><span class="type">GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE</span></a> and
<a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-UUENCODE:CAPS"><span class="type">GMIME_CONTENT_ENCODING_UUENCODE</span></a>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-init-encode"></a><h3>g_mime_encoding_init_encode ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_mime_encoding_init_encode (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
                             <em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> encoding</code></em>);</pre>
<p>Initializes a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a> state machine for encoding to
<em class="parameter"><code>encoding</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-encoding-init-encode.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a> to initialize</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>encoding</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-init-decode"></a><h3>g_mime_encoding_init_decode ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_mime_encoding_init_decode (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
                             <em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> encoding</code></em>);</pre>
<p>Initializes a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a> state machine for decoding from
<em class="parameter"><code>encoding</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-encoding-init-decode.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a> to initialize</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>encoding</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-reset"></a><h3>g_mime_encoding_reset ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_mime_encoding_reset (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>);</pre>
<p>Resets the state of the <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a>.</p>
<div class="refsect3">
<a name="g-mime-encoding-reset.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a> to reset</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-outlen"></a><h3>g_mime_encoding_outlen ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
g_mime_encoding_outlen (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
                        <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>);</pre>
<p>Given the input length, <em class="parameter"><code>inlen</code></em>
, calculate the needed output length
to perform an encoding or decoding step.</p>
<div class="refsect3">
<a name="g-mime-encoding-outlen.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inlen</p></td>
<td class="parameter_description"><p>an input length</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-encoding-outlen.returns"></a><h4>Returns</h4>
<p> the maximum number of bytes needed to encode or decode a
buffer of <em class="parameter"><code>inlen</code></em>
bytes.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-step"></a><h3>g_mime_encoding_step ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
g_mime_encoding_step (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
                      <em class="parameter"><code>const <span class="type">char</span> *inbuf</code></em>,
                      <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
                      <em class="parameter"><code><span class="type">char</span> *outbuf</code></em>);</pre>
<p>Incrementally encodes or decodes (depending on <em class="parameter"><code>state</code></em>
) an input
stream by 'stepping' through a block of input at a time.</p>
<p>You should make sure <em class="parameter"><code>outbuf</code></em>
 is large enough by calling
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-outlen" title="g_mime_encoding_outlen ()"><code class="function">g_mime_encoding_outlen()</code></a> to find out how large <em class="parameter"><code>outbuf</code></em>
 might need
to be.</p>
<div class="refsect3">
<a name="g-mime-encoding-step.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inbuf</p></td>
<td class="parameter_description"><p>an input buffer to encode or decode</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inlen</p></td>
<td class="parameter_description"><p>input buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>outbuf</p></td>
<td class="parameter_description"><p>an output buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-encoding-step.returns"></a><h4>Returns</h4>
<p> the number of bytes written to <em class="parameter"><code>outbuf</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-flush"></a><h3>g_mime_encoding_flush ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
g_mime_encoding_flush (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
                       <em class="parameter"><code>const <span class="type">char</span> *inbuf</code></em>,
                       <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
                       <em class="parameter"><code><span class="type">char</span> *outbuf</code></em>);</pre>
<p>Completes the incremental encode or decode of the input stream (see
<a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-step" title="g_mime_encoding_step ()"><code class="function">g_mime_encoding_step()</code></a> for details).</p>
<div class="refsect3">
<a name="g-mime-encoding-flush.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="struct GMimeEncoding"><span class="type">GMimeEncoding</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inbuf</p></td>
<td class="parameter_description"><p>an input buffer to encode or decode</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inlen</p></td>
<td class="parameter_description"><p>input buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>outbuf</p></td>
<td class="parameter_description"><p>an output buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-encoding-flush.returns"></a><h4>Returns</h4>
<p> the number of bytes written to <em class="parameter"><code>outbuf</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GMIME-BASE64-ENCODE-LEN:CAPS"></a><h3>GMIME_BASE64_ENCODE_LEN()</h3>
<pre class="programlisting">#define GMIME_BASE64_ENCODE_LEN(x) ((size_t) (((((x) + 2) / 57) * 77) + 77))
</pre>
<p>Calculates the maximum number of bytes needed to base64 encode the
full input buffer of length <em class="parameter"><code>x</code></em>
.</p>
<div class="refsect3">
<a name="GMIME-BASE64-ENCODE-LEN.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>Length of the input data to encode</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="GMIME-BASE64-ENCODE-LEN.returns"></a><h4>Returns</h4>
<p> the number of output bytes needed to base64 encode an input
buffer of size <em class="parameter"><code>x</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-base64-decode-step"></a><h3>g_mime_encoding_base64_decode_step ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
g_mime_encoding_base64_decode_step (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
                                    <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
                                    <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
                                    <em class="parameter"><code><span class="type">int</span> *state</code></em>,
                                    <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
<p>Decodes a chunk of base64 encoded data.</p>
<div class="refsect3">
<a name="g-mime-encoding-base64-decode-step.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>inbuf</p></td>
<td class="parameter_description"><p>input buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inlen</p></td>
<td class="parameter_description"><p>input buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>outbuf</p></td>
<td class="parameter_description"><p>output buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>save</p></td>
<td class="parameter_description"><p>leftover bits that have not yet been decoded</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-encoding-base64-decode-step.returns"></a><h4>Returns</h4>
<p> the number of bytes decoded (which have been dumped in
<em class="parameter"><code>outbuf</code></em>
).</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-base64-encode-step"></a><h3>g_mime_encoding_base64_encode_step ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
g_mime_encoding_base64_encode_step (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
                                    <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
                                    <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
                                    <em class="parameter"><code><span class="type">int</span> *state</code></em>,
                                    <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
<p>Base64 encodes a chunk of data. Performs an 'encode step', only
encodes blocks of 3 characters to the output at a time, saves
left-over state in state and save (initialise to 0 on first
invocation).</p>
<div class="refsect3">
<a name="g-mime-encoding-base64-encode-step.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>inbuf</p></td>
<td class="parameter_description"><p>input buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inlen</p></td>
<td class="parameter_description"><p>input buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>outbuf</p></td>
<td class="parameter_description"><p>output buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>save</p></td>
<td class="parameter_description"><p>leftover bits that have not yet been encoded</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-encoding-base64-encode-step.returns"></a><h4>Returns</h4>
<p> the number of bytes encoded.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-base64-encode-close"></a><h3>g_mime_encoding_base64_encode_close ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
g_mime_encoding_base64_encode_close (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
                                     <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
                                     <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
                                     <em class="parameter"><code><span class="type">int</span> *state</code></em>,
                                     <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
<p>Base64 encodes the input stream to the output stream. Call this
when finished encoding data with <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-base64-encode-step" title="g_mime_encoding_base64_encode_step ()"><code class="function">g_mime_encoding_base64_encode_step()</code></a>
to flush off the last little bit.</p>
<div class="refsect3">
<a name="g-mime-encoding-base64-encode-close.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>inbuf</p></td>
<td class="parameter_description"><p>input buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inlen</p></td>
<td class="parameter_description"><p>input buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>outbuf</p></td>
<td class="parameter_description"><p>output buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>save</p></td>
<td class="parameter_description"><p>leftover bits that have not yet been encoded</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-encoding-base64-encode-close.returns"></a><h4>Returns</h4>
<p> the number of bytes encoded.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GMIME-UUENCODE-LEN:CAPS"></a><h3>GMIME_UUENCODE_LEN()</h3>
<pre class="programlisting">#define GMIME_UUENCODE_LEN(x)      ((size_t) (((((x) + 2) / 45) * 62) + 64))
</pre>
<p>Calculates the maximum number of bytes needed to uuencode the full
input buffer of length <em class="parameter"><code>x</code></em>
.</p>
<div class="refsect3">
<a name="GMIME-UUENCODE-LEN.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>Length of the input data to encode</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="GMIME-UUENCODE-LEN.returns"></a><h4>Returns</h4>
<p> the number of output bytes needed to uuencode an input
buffer of size <em class="parameter"><code>x</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-uudecode-step"></a><h3>g_mime_encoding_uudecode_step ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
g_mime_encoding_uudecode_step (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
                               <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
                               <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
                               <em class="parameter"><code><span class="type">int</span> *state</code></em>,
                               <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
<p>Uudecodes a chunk of data. Performs a 'decode step' on a chunk of
uuencoded data. Assumes the "begin mode filename" line has
been stripped off.</p>
<div class="refsect3">
<a name="g-mime-encoding-uudecode-step.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>inbuf</p></td>
<td class="parameter_description"><p>input buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inlen</p></td>
<td class="parameter_description"><p>input buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>outbuf</p></td>
<td class="parameter_description"><p>output buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>save</p></td>
<td class="parameter_description"><p>leftover bits that have not yet been decoded</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-encoding-uudecode-step.returns"></a><h4>Returns</h4>
<p> the number of bytes decoded.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-uuencode-step"></a><h3>g_mime_encoding_uuencode_step ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
g_mime_encoding_uuencode_step (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
                               <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
                               <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
                               <em class="parameter"><code>unsigned <span class="type">char</span> *uubuf</code></em>,
                               <em class="parameter"><code><span class="type">int</span> *state</code></em>,
                               <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
<p>Uuencodes a chunk of data. Performs an 'encode step', only encodes
blocks of 45 characters to the output at a time, saves left-over
state in <em class="parameter"><code>uubuf</code></em>
, <em class="parameter"><code>state</code></em>
 and <em class="parameter"><code>save</code></em>
 (initialize to 0 on first
invocation).</p>
<div class="refsect3">
<a name="g-mime-encoding-uuencode-step.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>inbuf</p></td>
<td class="parameter_description"><p>input buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inlen</p></td>
<td class="parameter_description"><p>input buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>outbuf</p></td>
<td class="parameter_description"><p>output stream</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>uubuf</p></td>
<td class="parameter_description"><p>temporary buffer of 60 bytes</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>save</p></td>
<td class="parameter_description"><p>leftover bits that have not yet been encoded</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-encoding-uuencode-step.returns"></a><h4>Returns</h4>
<p> the number of bytes encoded.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-uuencode-close"></a><h3>g_mime_encoding_uuencode_close ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
g_mime_encoding_uuencode_close (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
                                <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
                                <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
                                <em class="parameter"><code>unsigned <span class="type">char</span> *uubuf</code></em>,
                                <em class="parameter"><code><span class="type">int</span> *state</code></em>,
                                <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
<p>Uuencodes a chunk of data. Call this when finished encoding data
with <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-uuencode-step" title="g_mime_encoding_uuencode_step ()"><code class="function">g_mime_encoding_uuencode_step()</code></a> to flush off the last little bit.</p>
<div class="refsect3">
<a name="g-mime-encoding-uuencode-close.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>inbuf</p></td>
<td class="parameter_description"><p>input buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inlen</p></td>
<td class="parameter_description"><p>input buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>outbuf</p></td>
<td class="parameter_description"><p>output buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>uubuf</p></td>
<td class="parameter_description"><p>temporary buffer of 60 bytes</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>save</p></td>
<td class="parameter_description"><p>leftover bits that have not yet been encoded</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-encoding-uuencode-close.returns"></a><h4>Returns</h4>
<p> the number of bytes encoded.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GMIME-QP-ENCODE-LEN:CAPS"></a><h3>GMIME_QP_ENCODE_LEN()</h3>
<pre class="programlisting">#define GMIME_QP_ENCODE_LEN(x)     ((size_t) ((((x) / 24) * 74) + 74))
</pre>
<p>Calculates the maximum number of bytes needed to encode the full
input buffer of length <em class="parameter"><code>x</code></em>
 using the quoted-printable encoding.</p>
<div class="refsect3">
<a name="GMIME-QP-ENCODE-LEN.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>Length of the input data to encode</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="GMIME-QP-ENCODE-LEN.returns"></a><h4>Returns</h4>
<p> the number of output bytes needed to encode an input buffer
of size <em class="parameter"><code>x</code></em>
using the quoted-printable encoding.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-quoted-decode-step"></a><h3>g_mime_encoding_quoted_decode_step ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
g_mime_encoding_quoted_decode_step (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
                                    <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
                                    <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
                                    <em class="parameter"><code><span class="type">int</span> *state</code></em>,
                                    <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
<p>Decodes a block of quoted-printable encoded data. Performs a
'decode step' on a chunk of QP encoded data.</p>
<div class="refsect3">
<a name="g-mime-encoding-quoted-decode-step.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>inbuf</p></td>
<td class="parameter_description"><p>input buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inlen</p></td>
<td class="parameter_description"><p>input buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>outbuf</p></td>
<td class="parameter_description"><p>output buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>save</p></td>
<td class="parameter_description"><p>leftover bits that have not yet been decoded</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-encoding-quoted-decode-step.returns"></a><h4>Returns</h4>
<p> the number of bytes decoded.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-quoted-encode-step"></a><h3>g_mime_encoding_quoted_encode_step ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
g_mime_encoding_quoted_encode_step (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
                                    <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
                                    <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
                                    <em class="parameter"><code><span class="type">int</span> *state</code></em>,
                                    <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
<p>Quoted-printable encodes a block of text. Performs an 'encode
step', saves left-over state in state and save (initialise to -1 on
first invocation).</p>
<div class="refsect3">
<a name="g-mime-encoding-quoted-encode-step.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>inbuf</p></td>
<td class="parameter_description"><p>input buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inlen</p></td>
<td class="parameter_description"><p>input buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>outbuf</p></td>
<td class="parameter_description"><p>output buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>save</p></td>
<td class="parameter_description"><p>leftover bits that have not yet been encoded</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-encoding-quoted-encode-step.returns"></a><h4>Returns</h4>
<p> the number of bytes encoded.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-encoding-quoted-encode-close"></a><h3>g_mime_encoding_quoted_encode_close ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
g_mime_encoding_quoted_encode_close (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
                                     <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
                                     <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
                                     <em class="parameter"><code><span class="type">int</span> *state</code></em>,
                                     <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
<p>Quoted-printable encodes a block of text. Call this when finished
encoding data with <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-quoted-encode-step" title="g_mime_encoding_quoted_encode_step ()"><code class="function">g_mime_encoding_quoted_encode_step()</code></a> to flush off
the last little bit.</p>
<div class="refsect3">
<a name="g-mime-encoding-quoted-encode-close.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>inbuf</p></td>
<td class="parameter_description"><p>input buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inlen</p></td>
<td class="parameter_description"><p>input buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>outbuf</p></td>
<td class="parameter_description"><p>output buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>save</p></td>
<td class="parameter_description"><p>leftover bits that have not yet been encoded</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-encoding-quoted-encode-close.returns"></a><h4>Returns</h4>
<p> the number of bytes encoded.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="gmime-gmime-encodings.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GMimeContentEncoding"></a><h3>enum GMimeContentEncoding</h3>
<p>A Content-Transfer-Encoding enumeration.</p>
<div class="refsect3">
<a name="GMimeContentEncoding.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GMIME-CONTENT-ENCODING-DEFAULT:CAPS"></a>GMIME_CONTENT_ENCODING_DEFAULT</p></td>
<td class="enum_member_description">
<p>Default transfer encoding.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GMIME-CONTENT-ENCODING-7BIT:CAPS"></a>GMIME_CONTENT_ENCODING_7BIT</p></td>
<td class="enum_member_description">
<p>7bit text transfer encoding.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GMIME-CONTENT-ENCODING-8BIT:CAPS"></a>GMIME_CONTENT_ENCODING_8BIT</p></td>
<td class="enum_member_description">
<p>8bit text transfer encoding.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GMIME-CONTENT-ENCODING-BINARY:CAPS"></a>GMIME_CONTENT_ENCODING_BINARY</p></td>
<td class="enum_member_description">
<p>Binary transfer encoding.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GMIME-CONTENT-ENCODING-BASE64:CAPS"></a>GMIME_CONTENT_ENCODING_BASE64</p></td>
<td class="enum_member_description">
<p>Base64 transfer encoding.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GMIME-CONTENT-ENCODING-QUOTEDPRINTABLE:CAPS"></a>GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE</p></td>
<td class="enum_member_description">
<p>Quoted-printable transfer encoding.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GMIME-CONTENT-ENCODING-UUENCODE:CAPS"></a>GMIME_CONTENT_ENCODING_UUENCODE</p></td>
<td class="enum_member_description">
<p>Uuencode transfer encoding.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GMimeEncodingConstraint"></a><h3>enum GMimeEncodingConstraint</h3>
<p>Used with functions like <a class="link" href="GMimeFilterBest.html#g-mime-filter-best-encoding" title="g_mime_filter_best_encoding ()"><code class="function">g_mime_filter_best_encoding()</code></a> and
<a class="link" href="GMimeObject.html#g-mime-object-encode" title="g_mime_object_encode ()"><code class="function">g_mime_object_encode()</code></a> as the 'constraint' argument. These values
provide a means of letting the filter know what the encoding
constraints are for the stream.</p>
<div class="refsect3">
<a name="GMimeEncodingConstraint.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GMIME-ENCODING-CONSTRAINT-7BIT:CAPS"></a>GMIME_ENCODING_CONSTRAINT_7BIT</p></td>
<td class="enum_member_description">
<p>The stream data must fit within the 7bit ASCII range.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GMIME-ENCODING-CONSTRAINT-8BIT:CAPS"></a>GMIME_ENCODING_CONSTRAINT_8BIT</p></td>
<td class="enum_member_description">
<p>The stream data may have bytes with the high bit set, but no null bytes.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GMIME-ENCODING-CONSTRAINT-BINARY:CAPS"></a>GMIME_ENCODING_CONSTRAINT_BINARY</p></td>
<td class="enum_member_description">
<p>The stream may contain any binary data.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GMimeEncoding"></a><h3>struct GMimeEncoding</h3>
<pre class="programlisting">struct GMimeEncoding {
	GMimeContentEncoding encoding;
	unsigned char uubuf[60];
	gboolean encode;
	guint32 save;
	int state;
};
</pre>
<p>A context used for encoding or decoding data.</p>
<div class="refsect3">
<a name="GMimeEncoding.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> <em class="structfield"><code><a name="GMimeEncoding.encoding"></a>encoding</code></em>;</p></td>
<td class="struct_member_description"><p>the type of encoding</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>unsigned <span class="type">char</span> <em class="structfield"><code><a name="GMimeEncoding.uubuf"></a>uubuf</code></em>[60];</p></td>
<td class="struct_member_description"><p>a temporary buffer needed when uuencoding data</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gboolean</span> <em class="structfield"><code><a name="GMimeEncoding.encode"></a>encode</code></em>;</p></td>
<td class="struct_member_description"><p><code class="literal">TRUE</code> if encoding or <code class="literal">FALSE</code> if decoding</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">guint32</span> <em class="structfield"><code><a name="GMimeEncoding.save"></a>save</code></em>;</p></td>
<td class="struct_member_description"><p>saved bytes from the previous step</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">int</span> <em class="structfield"><code><a name="GMimeEncoding.state"></a>state</code></em>;</p></td>
<td class="struct_member_description"><p>current encder/decoder state</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GMIME-UUDECODE-STATE-INIT:CAPS"></a><h3>GMIME_UUDECODE_STATE_INIT</h3>
<pre class="programlisting">#define GMIME_UUDECODE_STATE_INIT   (0)
</pre>
<p>Initial state for the <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-uudecode-step" title="g_mime_encoding_uudecode_step ()"><code class="function">g_mime_encoding_uudecode_step()</code></a> function.</p>
</div>
<hr>
<div class="refsect2">
<a name="GMIME-UUDECODE-STATE-BEGIN:CAPS"></a><h3>GMIME_UUDECODE_STATE_BEGIN</h3>
<pre class="programlisting">#define GMIME_UUDECODE_STATE_BEGIN  (1 &lt;&lt; 16)
</pre>
<p>State for the <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-uudecode-step" title="g_mime_encoding_uudecode_step ()"><code class="function">g_mime_encoding_uudecode_step()</code></a> function, denoting that
the 'begin' line has been found.</p>
</div>
<hr>
<div class="refsect2">
<a name="GMIME-UUDECODE-STATE-END:CAPS"></a><h3>GMIME_UUDECODE_STATE_END</h3>
<pre class="programlisting">#define GMIME_UUDECODE_STATE_END    (1 &lt;&lt; 17)
</pre>
<p>State for the <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-uudecode-step" title="g_mime_encoding_uudecode_step ()"><code class="function">g_mime_encoding_uudecode_step()</code></a> function, denoting that
the end of the UU encoded block has been found.</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.32</div>
</body>
</html>